/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Dao;

/**
 *
 * @author use
 */
public class Ngaysinh {
    public boolean validDate(int ngay,int thang,int nam) {
        int max = 1;
        switch (thang) {
            case 1:
            case 3:
            case 5:
            case 7:
            case 8:
            case 10:
            case 12:
                max = 31;
                break;
            case 4:
            case 6:
            case 9:
            case 11:
                max = 30;
                break;
            case 2:
                if (((nam % 4 == 0) && (nam % 100 != 0)) || (nam % 400 == 0)) {
                    max = 29;
                } else {
                    max = 28;
                }
                break;
        }
        if (ngay<=max) return true;
        else return false;
    }
}
